import { Fragment } from "vue/jsx-runtime";
import http from "./http";

/**
 * 获取数据库中所有表
 * @returns {Promise<axios.AxiosResponse<any>>}
 * @constructor
 */

export const test = (data: any) => http.get("http://192.168.151.120:8080/file/PageFile", {
    params: data
})

export const captcha = (data: any) => http.request({
    url: "/sys/user/captcha",
    params: data,
    responseType: "blob",
    method: "get"
})

export const login = (FromData: any) => http.post("/sys/user/login", FromData)

export const register = (FromData: any) => http.post("/sys/user/register", FromData)

//直播间

export const getLiveRoom = (params: any) => http.get("/back/liveRoom/getLiveRoomByPage", {
    params: params
})
export const getLiveRoomByLiveRoomId = (params:any) => http.get("/back/liveRoom/getLiveRoomByRoomNumber",{params:params})

export const addLiveRoom = (FormData :any) => http.post("/back/liveRoom/saveLiveRoom",FormData)

export const banLiveRoom = (params:any) => http.delete("/back/liveRoom/banLiveRoom",{
    params:params
})

export const liftBanLiveRoom = (params:any) =>http.delete("/back/liveRoom/liftBanLiveRoom",{
    params:params
})

export const deleteLiveRoom = (params:any) =>http.delete("/back/liveRoom/deleteLiveRoom",{
    params:params
})

export const updateLiveRoom = (FromData:any) =>http.post("/back/liveRoom/updateLiveRoom",FromData)

export const uploadImg = (params:File) => http.post("/oss/oss/update",{params:params})



//角色
export const roleList = (params:any) =>http.get("/sys/role/listByPage",{params:params})

export const deleteRoles = (params:any) =>http.delete("/sys/role/deleteById",{params:params})

export const updateRoles = (FromData:any) =>http.put("/sys/role/updateById",FromData)

export const addRoles = (FormData:any) =>http.post("/sys/role/save",FormData)


//用户
export const userList = (params:any) =>http.get("/sys/user/listByPage",{params:params})

export const getUserByUn = (params:any) =>http.get("/sys/user/getByUsername",{params:params})

export const updateUser = (FormData:any) =>http.put("/sys/user/update",FormData)

export const deleteUser = (params:any) =>http.delete(`/sys/user/${params.id}`)

//主播申请
export const pageApply = (params:any) =>http.get("/back/apply/pageApply",{params:params})

export const getIdentity = (id:String) =>http.get("/back/identityAuthentication/getById",{ params: { id } })

export const handleApply = (FormData:any) =>http.put("/back/apply/handleApply",FormData)

//举报




























// export const info = () => http.get("/sys/user/info")
// export const getUserById = (path: string) => http.get("/sys/user/" + path);

// export const createConference = (FromData: any) => http.post("/sys/conference/create", FromData)


// export const intoConference = (FromData: any) => http.post("/sys/conference/into", FromData)

// export const commitConfence = (FromData: any) => http.post("/sys/conference/commit", FromData)

// export const leaveConfence = (path: string) => http.delete("/sys/conference/" + path)

export const conferenceUserPage = (params: any) => http.get("/sys/ConferenceUser/page", { params: params })

// export const DelConferenceUser = (path: string) => http.delete("/sys/ConferenceUser/" + path)
// export const UpdateUser = (FromDate: any) => http.put("/sys/user/update", FromDate)

// export const GetUserConferenceRecord = (params: any) => http.get("/sys/ConferenceUser/record", {params: params})

// export const ConferenceVideoList = (params: any) => http.get("/sys/conference/videoList", {params: params})

